﻿<%@ WebHandler Language="C#" Class="chkapply_count" %>

using System;
using System.Web;
using TSqlServer;

public class chkapply_count : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        string stat = context.Request["status"].ToString();
        string sSql = "select count(*) from vw_givelist where status=" + stat;
        int iCount = TSqlDB.ExecuteScalar(sSql);
        string result="";
        switch (stat)
        {
            case "1":
                result="新申请共计："+iCount.ToString()+"条";
                break;
            case "2":
                result="续申请共计："+iCount.ToString()+"条";
                break;
            case "4":
                result="未通过共计："+iCount.ToString()+"条";
                break;
            case "5":
                result="已通过共计："+iCount.ToString()+"条";
                break;
        }
        
        
        context.Response.ContentType = "text/plain";
        context.Response.Write(result);
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}